package com.example.movie.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 评论表，用于存储用户对电影的评论信息
 * @TableName comment
 */
@TableName(value ="comment")
@Data
public class Comment implements Serializable {
    /**
     * 评论id
     */
    @TableId(value = "c_id", type = IdType.AUTO)
    private Long id;

    /**
     * 评论来源用户id
     */
    @TableField(value = "c_uid")
    private Long userId;

    /**
     * 评论电影id
     */
    @TableField(value = "c_mid")
    private Long movieId;

    /**
     * 评价内容
     */
    @TableField(value = "c_info")
    private String info;

    /**
     * 电影评分
     */
    @TableField(value = "c_score")
    private Integer score;

    /**
     * 用户名 (冗余字段)
     */
    @TableField(exist = false)
    private String userName;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}